﻿#!/bin/bash

echo 'run this script before do anything.'

echo 'prepare for install ubuntu on zfs root'

echo "deb cdrom:[Ubuntu 18.04.3 LTS _Bionic Beaver_ - Release amd64 (20190805)]/ bionic main restricted
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe 
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe  
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe" > /etc/apt/sources.list


echo 'install openssh-server and change password for root to enable remote terminal access.'
apt update && apt install openssh-server -y
echo "root:ZeroPlus2013" | sudo chpasswd
sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config  && systemctl restart sshd && systemctl restart ssh